import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'virtual:svg-icons-register'
import '@/assets/css/common.css'
import * as IconsVue from '@element-plus/icons-vue'

const modules = import.meta.globEager('./components/**/index.ts')

const app = createApp(App)
app.use(router)

for (const path in modules) {
  app.use(modules[path].default)
}

let k: keyof typeof IconsVue

for (k in IconsVue) {
  app.component(k, IconsVue[k])
}

app.mount('#app')
